home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 103 / MacAddict_103_2005-03.iso / Software / Graphics & Multimedia / MulleSight 1.0.9.dmg / MulleSightAsWebcam.applescript < prev    next >
Encoding:
Text File  |  2004-12-27  |  853 b   |  36 lines

  1. try
  2.     -- AppleScript still uses old file/alias magic by default
  3.     -- therefore we have to use POSIX
  4.     set srcImg to (POSIX path of "/tmp/picture.tiff")
  5.     
  6.     tell application "MulleSight"
  7.         
  8.         -- save prior state
  9.         set shouldScale to should scale
  10.         set useSelection to use selection
  11.         
  12.         -- now set what we need
  13.         set should scale to false
  14.         set use selection to false
  15.         
  16.         -- save the image as TIFF (other formats are not supported)...
  17.         save in srcImg as "tiff"
  18.         
  19.         -- reset prior state
  20.         set should scale to shouldScale
  21.         set use selection to useSelection
  22.     end tell
  23.     
  24.     -- just for the fun of it, convert TIFF into JPEG
  25.     set dstImg to (POSIX path of "/tmp/picture.jpg")
  26.     tell application "Image Events"
  27.         launch
  28.         set img to open srcImg
  29.         save img as JPEG in file dstImg with icon
  30.         close img
  31.     end tell
  32.     
  33. on error errorMsg
  34.     display dialog errorMsg
  35. end try
  36.